package com.thti.mecool.client.adapter;

import java.util.List;

import com.threeti.mecool.mobile.interfaces.dto.MemoDto;
import com.thti.mecool.client.activity.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class WorkMemoShowAdapter extends BaseAdapter{
	private List<MemoDto> MemoList;
	private Context context;
	public WorkMemoShowAdapter(List<MemoDto> MemoList,Context context) {
this.MemoList=MemoList;
this.context=context;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return MemoList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return MemoList.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view=LayoutInflater.from(context).inflate(R.layout.mecool_workmemo_first, null);
		TextView content,shop,time;
		content=(TextView)view.findViewById(R.id.mecool_workmemo_first_content);
		shop=(TextView)view.findViewById(R.id.mecool_workmemo_first_shop);
		time=(TextView)view.findViewById(R.id.mecool_workmemo_first_time);
		view.setTag(position);
		content.setText(MemoList.get(position).getContent());
		shop.setText(MemoList.get(position).getChannelName());
		time.setText(MemoList.get(position).getRecordDate());
		return view;
	}

}
